<?php @session_start();?>
<?php
require_once('./safe.php');
require_once('../admin/config.php');
$conn = mysql_connect($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd);
mysql_select_db($cfg_dbname,$conn);

// $app_id=$_REQUEST["app_id"];
// if(!empty($app_id)){
$content = file_get_contents('php://input');
$post    = json_decode($content, true);
$app_id = $post['app_id'];

$sqla="select * from ph_keywords where userid='".$_SESSION["userid"]."' and app_name='".$app_id."'";
$resulta=mysql_query($sqla);

 header("Content-type:application/json");
$str1='[';
while($rowa=mysql_fetch_array($resulta)){
$str.='{"id":'.$rowa["ID"].',"app_id":"'.$rowa["app_name"].'","name":"'.$rowa["keywords"].'","updated_at":"2021-05-25T19:15:08.000000Z","created_at":"2021-05-25T19:15:08.000000Z","deleted_at":null,"latest_rank":null},';
}
 $str2=']';
 $str3=substr($str,0,strlen($str)-1);

 echo $str1.$str3.$str2;

?>